using MediatR;
using Medical.Api.Read.Application.Command.Wms.WmsLssueCommand;
using Medical.ErrorCode;
using Medical.Api.Read.Service.WmsService;
using System.Threading;
using System.Threading.Tasks;
using Medical.Api.Read.Dto.WmsDto.WmsLssueDto;

namespace Medical.Api.Read.Application.Handler.Wms.WmsLssueHandler
{
    /// <summary>
    /// 发放分页列表处理器
    /// </summary>
    public class GetLssueByPageHandler : IRequestHandler<GetLssueByPageCommand, ApiResult<ApiPageIng<WmsLssuePageDto>>>
    {
        private readonly IWmsService _service;
        public GetLssueByPageHandler(IWmsService service) { _service = service; }
        public async Task<ApiResult<ApiPageIng<WmsLssuePageDto>>> Handle(GetLssueByPageCommand request, CancellationToken cancellationToken)
        {
            return await _service.GetLssueByPageAsync(request.QueryDto);
        }
    }
}